import {Spin} from "antd";
import style from "./Loading.module.scss";
import {connect} from "react-redux";

const Loading = (props) => {
    return (
        <div className={style.example} style={{display: props.spinning ? "block" : "none"}}>
            <div className={style.example_div}><Spin spinning={props.spinning}/></div>
        </div>
    );
}

const mapStoreToProps = (state) => {
    return {
        spinning: state.MyLoadingRedux.spinning,
    }
}

export default connect(mapStoreToProps)(Loading);
